package com.gorhaf.coder.mvc.ws;

import jakarta.websocket.server.PathParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 游戏请求处理层
 *
 * @author 宋春鹏
 */
@RestController
@RequestMapping("/websocket")
public class GameController {

    @Autowired
    private GameEndpoint gameEndpoint;

    @GetMapping("/send")
    public void sendMessage(@PathParam("userId") String userId,
                            @PathParam("message") String message) {
        gameEndpoint.sendMessage(userId, message);
    }

}
